﻿@model SDSystem.Models.ServiceMaintain   
@using Ext.Net.MVC;
@using Ext.Net;
@{
    ViewBag.Title = "Detail";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


@(Html.X().FormPanel()
            .ID("FormPanel1")
            .MarginSpec("0 0 0 0")
            .TopBar(Html.X().Toolbar().Items(items =>
                                                        {
                                                            items.Add(new ToolbarTextItem {Text = "<h3 style=\"color:green\">Service Details</h3>"});

                                                            items.Add(new ToolbarFill());
                                                        })
                                            .Items(
                                                        
                                                        Html.X().Button().Text("<b>Back</b>").Icon(Icon.PageBack).Margins("0 20 0 0")
                                                        .Listeners(ls => ls.Click.Handler = "parentAutoLoadControl.close();")
                                                            
                                            )

                            )
            //.Listeners(ls => ls.ValidityChange.Handler="App.")
            .Items(
                    Html.X().TabPanel()
                    .ID("ServiceTabPanel")
                    .MarginSpec("0 0 0 0")
                    .Items(
                     Html.X().FormPanel()
                     .BodyPadding(10)
                     .ID("Detail1")
                     .Title("Detail1")
                     .Layout(LayoutType.Form)
                     .Items(
                      Html.X().FieldContainer()
                              .Layout(LayoutType.HBox)
                              .Items(
                              Html.X().HiddenFor(m=> m.ServiceId).ID("getServiceId"),
                               Html.X().TextFieldFor(m => m.ServiceName).Flex(1).Margins("0 10 10 5").FieldLabel("Service Name <font color=\"red\">*</font>").LabelWidth(200).MsgTarget(MessageTarget.Side),
                               Html.X().Checkbox().ID("checkServiceActive").Flex(1).Margins("0 10 10 5").FieldLabel("Service Active").LabelWidth(200).Value(ViewBag.ServiceActive)
                                    ),
                      Html.X().FieldContainer()
                              .Layout(LayoutType.HBox)
                              .Items(
                               Html.X().TextAreaFor(m => m.ServiceShortDes).Rows(3).Flex(1).Margins("0 10 10 5").FieldLabel("Service Short Description <font color=\"red\">*</font>").LabelWidth(200).MsgTarget(MessageTarget.Side),
                               Html.X().TextAreaFor(m => m.ServiceFullDes).Rows(3).Flex(1).Margins("0 10 10 5").FieldLabel("Service Full Description").LabelWidth(200)
                                    ),
                      Html.X().FieldContainer()
                              .Layout(LayoutType.HBox)
                              .Items(
                               Html.X().ComboBoxFor(m => m.SubType).ID("subType").Flex(1).Margins("0 10 10 5").FieldLabel("Sub Type").LabelWidth(200)
                               .Items(new ListItem("Funding", "Funding"), new ListItem("Contract", "Contract")),
                               Html.X().TextFieldFor(m => m.DeptCode).Flex(1).Margins("0 10 10 5").FieldLabel("Dept Code <font color=\"red\">*</font>").LabelWidth(200).MsgTarget(MessageTarget.Side)
                                    ),
                      Html.X().FieldContainer()
                              .Layout(LayoutType.HBox)
                              .Items(
                               Html.X().FieldContainer().Flex(1).Margins("0 10 10 5").Layout(LayoutType.HBox).Items(
                                        Html.X().TextField().ID("ContactLookup").Margins("0 10 10 0").FieldLabel("Lead Contact <font color=\"red\">*</font>").LabelWidth(200).Text(ViewBag.ContactTypes).AllowBlank(false).MsgTarget(MessageTarget.Side),
                                    Html.X().HiddenFor(m => m.ContactId).ID("hIdLookup"),
                                    Html.X().LinkButton().Text("Lookup").Margins("0 155 10 5").Listeners(
                                                li => li.Click.Handler = "showWindow('Lookup','/Contact/List/?text=ContactLookup&id=hIdLookup',true,0.85,0.85);")
                                    ),
                               Html.X().ComboBoxFor(m => m.ServiceType).Flex(1).Margins("0 10 10 5").FieldLabel("Service Type <font color=\"red\">*</font>").LabelWidth(200).Items(
                               ViewBag.ServiceType
                               ).MsgTarget(MessageTarget.Side)
                                    ),
                      Html.X().FieldContainer()
                              .Layout(LayoutType.HBox)
                              .Items(
                               Html.X().TextAreaFor(m => m.ClientDescription).Rows(3).Flex(1).Margins("0 10 10 5").FieldLabel("Client Description").LabelWidth(200),
                               Html.X().TextAreaFor(m => m.ServiceDesDelivery).Rows(3).Flex(1).Margins("0 10 10 5").FieldLabel("Service Description-Delivery").LabelWidth(200)
                                    ),
                      Html.X().FieldContainer()
                              .Layout(LayoutType.HBox)
                              .Items(
                               Html.X().ComboBoxFor(m => m.ServiceAttendance).Flex(1).Margins("0 10 10 5").FieldLabel("Service Attendance").LabelWidth(200),
                               Html.X().TextFieldFor(m => m.ServiceContractCode).Flex(1).Margins("0 10 10 5").FieldLabel("Service Contract Code").LabelWidth(200)
                                    ),
                      Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().FieldContainer().Flex(1).Margins("0 10 10 5").Layout(LayoutType.VBox).Items(
                                Html.X().DateFieldFor(m => m.ServiceStartExpected).ID("startExpected").FieldLabel("Service Start Expected").LabelWidth(200).EmptyText("<dd/MM/yy>")
                                ),
                                Html.X().TextFieldFor(m => m.ServiceContractValue).Flex(1).Margins("0 10 10 5").FieldLabel("Service Contract Value").LabelWidth(200)
                                        ),
                       Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().FieldContainer().Flex(1).Margins("0 10 10 5").Layout(LayoutType.VBox).Items(
                                Html.X().DateFieldFor(m => m.ServiceStartDate).ID("startDate").FieldLabel("Service Start Date").LabelWidth(200).EmptyText("<dd/MM/yyy>")
                                ),
                                Html.X().Checkbox().ID("checkStagePayment").Flex(1).Margins("0 10 10 5").FieldLabel("Contract Staged Payment").LabelWidth(200).Value(ViewBag.ServiceStagePayment)
                                        ),
                        Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().FieldContainer().Flex(1).Margins("0 10 10 5").Layout(LayoutType.VBox).Items(
                                Html.X().DateFieldFor(m => m.ServiceEndDate).ID("endDate").FieldLabel("Service End Date").LabelWidth(200).EmptyText("<dd/MM/yyy>")
                                ),
                                Html.X().ComboBoxFor(m => m.ReferralProcess).Flex(1).Margins("0 10 10 5").FieldLabel("Referral Process/Method").LabelWidth(200)
                                        ),
                       Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                               Html.X().FieldContainer().Flex(1).Margins("0 10 10 5").Layout(LayoutType.VBox).Items(
                                    Html.X().Checkbox().ID("checkServiceExtendable").FieldLabel("Service Extendable").LabelWidth(200),
                                    Html.X().FieldContainer().ID("extendField").Margins("0 10 10 5").Layout(LayoutType.HBox).Items
                                        (
                                            Html.X().NumberField().ID("yearEx").MinValue(0).Value(ViewBag.YearEx).Step(1).Margins("0 0 10 200").Width(60),
                                            Html.X().Label().Text("Years").Margins("0 10 10 5"),
                                            Html.X().NumberField().ID("monthEx").MinValue(0).MaxValue(11).Value(ViewBag.MonthEx).Step(1).Margins("0 0 10 5").Width(60),
                                            Html.X().Label().Text("Months").Margins("0 10 10 5")
                                        ).Disabled(!ViewBag.ServiceExtendable)
                                      ),
                                Html.X().FieldContainer().Flex(1).Margins("0 10 10 5").Layout(LayoutType.VBox).Items(
                                    Html.X().Checkbox().ID("checkServiceTimeLimited").FieldLabel("Service Time Limited").LabelWidth(200),
                                    Html.X().FieldContainer().ID("limitField").Margins("0 10 10 5").Layout(LayoutType.HBox).Items
                                        (
                                            Html.X().NumberField().ID("yearLi").MinValue(0).Value(ViewBag.YearLi).Step(1).Margins("0 0 10 200").Width(60),
                                            Html.X().Label().Text("Years").Margins("0 10 10 5"),
                                            Html.X().NumberField().ID("monthLi").MinValue(0).MaxValue(11).Value(ViewBag.MonthLi).Step(1).Margins("0 0 10 5").Width(60),
                                            Html.X().Label().Text("Months").Margins("0 10 10 5")
                                        ).Disabled(!ViewBag.ServiceTimeLimited)
                                     ))
                           ),

             Html.X().FormPanel()
                     .Title("Detail2")
                     .BodyPadding(10)
                     .Layout(LayoutType.Form)
                     .Items(
                      Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().MultiCombo().ID("ServiceBenefitsCriterion").FieldLabel("Service Benefits Criterion").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                        .SelectedItems(ViewBag.selectedServiceRef)
                                        .Items(ViewBag.ServiceBenefitsCriterion)    
                                //.Items(
                                    // Html.X().ListItem().Text("Disability Living Allowance"),
                                    // Html.X().ListItem().Text("Employment and Support Allowance"),
                                    // Html.X().ListItem().Text("Incapacity Benifit"),
                                    // Html.X().ListItem().Text("Income Support"),
                                    // Html.X().ListItem().Text("Job Seekers Allowance")

                                    //)
                                    ,
                                 Html.X().MultiCombo().ID("ServiceDisability").FieldLabel("Service Disability Criterion").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                        .SelectedItems(ViewBag.selectedServiceRef)    
                                        .Items(ViewBag.ServiceDisability)
                                    // Html.X().ListItem().Text("Chest, Breathing problems"),
                                    // Html.X().ListItem().Text("Condition restricting mobility/dexterity"),
                                    // Html.X().ListItem().Text("Diabetes"),
                                    // Html.X().ListItem().Text("Difficulty in hearing"),
                                    // Html.X().ListItem().Text("Difficulty in seeing")

                                    //)
                                ),
                         Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().MultiCombo().ID("ServiceBarriers").FieldLabel("Service Barriers Criterion").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                        .SelectedItems(ViewBag.selectedServiceRef)
                                        .Items(ViewBag.ServiceBarriers),
                                    // Html.X().ListItem().Text("Lone Parent"),
                                    // Html.X().ListItem().Text("ESOL"),
                                    // Html.X().ListItem().Text("Refugee"),
                                    // Html.X().ListItem().Text("Basic Skills")

                                    //),
                                 Html.X().MultiCombo().ID("ServicePersonal").FieldLabel("Service Personal Circumstances Criterion").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                     .SelectedItems(ViewBag.selectedServiceRef)
                                     .Items(ViewBag.ServicePersonal)
                                    // Html.X().ListItem().Text("Carer Responsibilities"),
                                    // Html.X().ListItem().Text("Lone Parent")

                                    //)
                                ),
                            Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().MultiCombo().ID("ServiceEthnicity").FieldLabel("Service Ethnicity Criterion").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.ServiceEthnicity)
                                    ,
                                    // Html.X().ListItem().Text("White British"),
                                    // Html.X().ListItem().Text("White Irish"),
                                    // Html.X().ListItem().Text("Other White"),
                                    // Html.X().ListItem().Text("White & Black Caribbean"),
                                    //     Html.X().ListItem().Text("White & Black African")

                                    //),
                                 Html.X().MultiCombo().ID("OtherServiceParticipation").FieldLabel("Other Service Participation Criterion").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.OtherServiceParticipation)
                                    // Html.X().ListItem().Text("Referral to Mainstream Service First"),
                                    // Html.X().ListItem().Text("Only Access Service Once"),
                                    // Html.X().ListItem().Text("Only Access Service Once Per Year")

                                    //)
                                )

                     ),
             Html.X().FormPanel()
                     .Title("Detail3")
                     .BodyPadding(10)
                     .Layout(LayoutType.Form)
                     .Items(
                      Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().MultiCombo().ID("ClientSupportProcess").FieldLabel("Client Support Process").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.ClientSupportProcess),
                                    // Html.X().ListItem().Text("Referral").Value("1"),
                                    // Html.X().ListItem().Text("Initial Contact").Value("2"),
                                    // Html.X().ListItem().Text("Pre Employment").Value("3"),
                                    // Html.X().ListItem().Text("In Work Support").Value("4")

                                    //),
                                 Html.X().MultiCombo().ID("ClientOutcome").FieldLabel("Client Outcome").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.ClientOutcome)
                                ),
               Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().MultiCombo().ID("Intervention").FieldLabel("Intervention").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.Intervention),
                                 Html.X().MultiCombo().ID("TargetClient").FieldLabel("Target Client").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.TargetClient)
                                ),
              Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().MultiCombo().ID("ClientJourney").FieldLabel("Client Journey").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.ClientJourney),
                                 Html.X().MultiCombo().ID("Accreditations").FieldLabel("Accreditations").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.Accreditations)
                                ),
               Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().MultiCombo().ID("OtherServices").FieldLabel("Other Services").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.OtherServices),
                                Html.X().MultiCombo().ID("ReferralSources").FieldLabel("Referral Sources").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.ReferralSources)
                                ),
              Html.X().FieldContainer()
                               .Layout(LayoutType.HBox)
                               .Items(
                                Html.X().MultiCombo().ID("SupportCentres").FieldLabel("Support Centres").LabelWidth(200).Margins("0 10 10 5").Flex(1)
                                    .SelectedItems(ViewBag.selectedServiceRef)
                                    .Items(ViewBag.SupportCentres),
                                 //Html.X().ComboBoxFor(m => m.Programme).ID("comboProgramme").FieldLabel("Programme").Items(ViewBag.ProgrammeId).LabelWidth(200).Margins("0 10 10 5").Flex(1),
                                 Html.X().ComboBoxFor(m => m.Programme).Flex(1).Margins("0 10 10 5").FieldLabel("Programme").LabelWidth(200).SelectedItems( ViewBag.selectedProgramme).Items(
                                   ViewBag.Programme
                               )
                                )
                     )
                        )
                    )
          )
                        